package cn.merryyou.security.config;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.vote.AffirmativeBased;
import org.springframework.security.web.access.intercept.FilterSecurityInterceptor;
import org.springframework.stereotype.Component;

/**
 * @author YuanYifeng
 * @description: TODO
 * @date 2019/4/23 11:57
 */
@Component
public class CustomFilterSecurityInterceptor extends FilterSecurityInterceptor implements InitializingBean {

    @Autowired
   private  AffirmativeBased affirmativeBased ;
/*    @Autowired
    private AuthenticationManager authenticationManager;*/

    @Autowired
    private DatabaseFilterInvocationSecurityMetadataSource databaseFilterInvocationSecurityMetadataSource;
    @Override
    public void afterPropertiesSet(){
        this.setAccessDecisionManager(affirmativeBased);
/*        this.setAuthenticationManager(authenticationManager);*/
        this.setSecurityMetadataSource(databaseFilterInvocationSecurityMetadataSource);
    }
}
